#!/bin/bash
# $1 serialnumber

privatekey=`echo "select PrivateKey from user where serialnumber = ${1};" |sqlite3 shackspacekey.sql3`
fname=`echo "select Givenname from user where serialnumber = ${1};" |sqlite3 shackspacekey.sql3`
lname=`echo "select Surname from user where serialnumber = ${1};" |sqlite3 shackspacekey.sql3`

thunderbird -compose "to=${fname}@${lname},subject=\"Userkey for ${fname}\",body=${privatekey}"
